using MicroMsg.UI.Page;
using Microsoft.Phone.Controls.Maps;
using System;
namespace MicroMsg.UI.Chat.Map
{
	public class GoogleTileSource : TileSource
	{
		private const string url_zh_cn = "http://mt{0}.google.cn/vt/lyrs=m@180000000&hl=zh-CN&gl=cn&src=app&x={1}&y={2}&z={3}";
		private const string url_zh_tw = "http://mt{0}.google.cn/vt/lyrs=m@180000000&hl=zh-TW&src=app&x={1}&y={2}&z={3}";
		private const string url_en = "http://mt{0}.google.cn/vt/lyrs=m@180000000&hl=en&src=app&x={1}&y={2}&z={3}";
		public GoogleTileSource() : base(GoogleTileSource.getUrl())
		{
		}
		public static string getUrl()
		{
			if (R.isChineseCN())
			{
				return "http://mt{0}.google.cn/vt/lyrs=m@180000000&hl=zh-CN&gl=cn&src=app&x={1}&y={2}&z={3}";
			}
			if (R.isChineseTW())
			{
				return "http://mt{0}.google.cn/vt/lyrs=m@180000000&hl=zh-TW&src=app&x={1}&y={2}&z={3}";
			}
			return "http://mt{0}.google.cn/vt/lyrs=m@180000000&hl=en&src=app&x={1}&y={2}&z={3}";
		}
		public override Uri GetUri(int int_0, int int_1, int zoomLevel)
		{
			int num = (int_0 & 1) << 1 | (int_1 & 1);
			return new Uri(string.Format(base.UriFormat, new object[]
			{
				num,
				int_0,
				int_1,
				zoomLevel
			}));
		}
	}
}
